import React, { useEffect, useState } from 'react'

// 这是react的展示组件
export default function Count(props) {
  console.log(props)
  return (
    <div>
      <p>{props.c}</p>
      <button
        onClick={() => {
          props.add(1)
        }}
      >
        +1
      </button>
      <button
        onClick={() => {
          props.add(3)
        }}
      >
        + 3
      </button>
      <button
        onClick={() => {
          props.sub(4)
        }}
      >
        -
      </button>
    </div>
  )
}
